package com.quik.web.product.service;

import java.util.List;

import com.quik.entity.DtaProduct;
import com.quik.entity.DtaProductCategory;
import com.quik.entity.DtaProductSubCategory;

/**
 * 功能说明：
 *         产品业务逻辑
 * @author Jenny
 *
 */
public interface ProductService {
	/**
	 * 查询分类的总数
	 * @param categoryName
	 * @return
	 * @throws Exception
	 */
	public int findCategoryCount(String categoryName) throws Exception;
	
	/**
	 * 根据商品名称查询商品分类
	 * @param categoryName
	 * @param intPage
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List findCategory(String categoryName, int intPage, int pageSize) throws Exception;
	
	/**
	 * 查询商品分类
	 * @param categoryName
	 * @param intPage
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public List findCategory() throws Exception;
	
	/**
	 * 是否已存在相同商品类别
	 * @param categoryName
	 * @return
	 * @throws Exception
	 */
	public boolean isExistCategory(String categoryName) throws Exception;
	
	/**
	 * 新增商品大类
	 * @param category
	 * @throws Exception
	 */
	public void addCategory(DtaProductCategory category) throws Exception;
	
	/**
	 * 同一大类下是否已存在相同商品子类
	 * @param categoryName
	 * @return
	 * @throws Exception
	 */
	public boolean isExistSubCategory(String subCategoryName, Integer categoryId) throws Exception;
	
	/**
	 * 新增商品子类
	 * @param category
	 * @throws Exception
	 */
	public void addSubCategory(DtaProductSubCategory subCategory) throws Exception;
	
	/**
	 * 根据条件查询商品总数
	 * @param categoryId
	 * @param subCategoryId
	 * @param productNo
	 * @param productName
	 * @return
	 * @throws Exception
	 */
	public int findProductCount(Integer categoryId, Integer subCategoryId, String productNo, String productName) throws Exception;
	
	/**
	 * 根据条件查询商品列表
	 * @param categoryId
	 * @param subCategoryId
	 * @param productNo
	 * @param productName
	 * @return
	 * @throws Exception
	 */
	public List findProduct(Integer categoryId, Integer subCategoryId, String productNo, String productName,
			int intPage, int pageSize) throws Exception;
	
	/**
	 * 根据类别ID查询子类列表
	 * @param categoryId
	 * @return
	 * @throws Exception
	 */
	public List findSubCategoryByCategoryId(Integer categoryId) throws Exception;
	
	/**
	 * 检查是否有重复的商品编码
	 * 
	 * @return 如果重复 返回true, 否则false
	 */
	public boolean checkProductNo(String productNo) throws Exception;
	
	/**
	 * 新增商品
	 * @param product
	 * @throws Exception
	 */
	public void addProduct(DtaProduct product) throws Exception;
	
	
	public List<DtaProduct> findAllProduct();
	
	public List<DtaProductCategory> findAllProductCategory();
	
	public List<DtaProductSubCategory> findAllproductSubCategory();
}
